/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pruebaes.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author luisfernando
 */
@Entity
@Table(name = "trackings")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Trackings.findAll", query = "SELECT t FROM Trackings t"),
    @NamedQuery(name = "Trackings.findById", query = "SELECT t FROM Trackings t WHERE t.id = :id"),
    @NamedQuery(name = "Trackings.findByFecha", query = "SELECT t FROM Trackings t WHERE t.fecha = :fecha"),
    @NamedQuery(name = "Trackings.findByProxima", query = "SELECT t FROM Trackings t WHERE t.proxima = :proxima"),
    @NamedQuery(name = "Trackings.findByObservacion", query = "SELECT t FROM Trackings t WHERE t.observacion = :observacion"),
    @NamedQuery(name = "Trackings.findByUserid", query = "SELECT t FROM Trackings t WHERE t.userid = :userid")})
public class Trackings implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Column(name = "proxima")
    @Temporal(TemporalType.DATE)
    private Date proxima;
    @Size(max = 2147483647)
    @Column(name = "observacion")
    private String observacion;
    @Size(max = 2147483647)
    @Column(name = "userid")
    private String userid;
    @JoinColumn(name = "permiso", referencedColumnName = "id")
    @ManyToOne
    private Permisos permiso;
    @JoinColumn(name = "novedad", referencedColumnName = "id")
    @ManyToOne
    private Novedades novedad;

    public Trackings() {
    }

    public Trackings(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Date getProxima() {
        return proxima;
    }

    public void setProxima(Date proxima) {
        this.proxima = proxima;
    }

    public String getObservacion() {
        return observacion;
    }

    public void setObservacion(String observacion) {
        this.observacion = observacion;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public Permisos getPermiso() {
        return permiso;
    }

    public void setPermiso(Permisos permiso) {
        this.permiso = permiso;
    }

    public Novedades getNovedad() {
        return novedad;
    }

    public void setNovedad(Novedades novedad) {
        this.novedad = novedad;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Trackings)) {
            return false;
        }
        Trackings other = (Trackings) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.pruebaes.entidades.Trackings[ id=" + id + " ]";
    }
    
}
